﻿
using System.Web.Mvc;

namespace UserDemo.Controllers
{
    /// <summary>
    /// 用户信息
    /// </summary>
    public class InfoController : Controller
    {
        // GET: User
        public ActionResult Index()
        {
            var user = Session["User"] as LoginInfo;
            if (user == null || user.UserId < 1 || user.Role != Role.User)
            {
                return Redirect("/account/index");
            }
            ViewBag.UserId = user.UserId;
            ViewBag.LoginName = user.LoginName;
            ViewBag.Role = user.Role;
            ViewBag.NickName = user.NickName;
            return View();
        }
    }
}